home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / ansippv2 / pp.man < prev    next >
Text File  |  1988-09-11  |  5KB  |  129 lines

  1. PP (1)                                                                PP (1)
  2.  
  3. NAME
  4.  
  5.         PP - Standalone ANSI-conforming C language preprocessor Version 2
  6.  
  7. SYNOPSIS
  8.  
  9.         pp [ option ] [ file ] ...
  10.  
  11. DESCRIPTION
  12.  
  13.         pp copies the input [ files ] (standard input default) to standard
  14.         output, expanding C language macros and executing C language
  15.         preprocessor directives as specified in the Draft Proposed ANSI
  16.         Standard for the C Language.
  17.  
  18.         It is beneficial to refer to the input file by name, rather than
  19.         redirecting standard input, so that diagnostics can include the file
  20.         name.
  21.  
  22.         The following options are recognized.
  23.  
  24.         -d or -D        Define the following (empty) macro.
  25.         -c or -C        Include comments in output.
  26.         -l or -L        Include #line directives in output.
  27.         -p or -P        Include #pragma directives in output.
  28.         -m or -M        Replace macros in #pragma directives.
  29.  
  30.         The preprocessed output may be used as input to most C compilers.
  31.  
  32.         If the -l option is used, #line directives are included in the output,
  33.         so that diagnostics produced by the C compiler will refer to the
  34.         original source file, or to the source file indicated in input #line
  35.         directives.
  36.  
  37.         If the -p option is used, #pragma directives encountered are copied to
  38.         the output.  The -m option is required if the C compiler normally
  39.         replaces macros in #pragma directives.
  40.  
  41. EXAMPLES
  42.  
  43.         The following command displays the source file PPMACRO.C on standard
  44.         output, after performing all preprocessing directives and replacing
  45.         all macros.  The output does not include #line or #pragma directives.
  46.         Comments are discarded.
  47.  
  48.                 pp ppmacro.c
  49.  
  50.         The following command displays the preprocessed source file PPTOK.C on
  51.         standard output.  #line directives are included, but contain no
  52.         filename, since the source file was redirected to standard input,
  53.         rather than named as a parameter to PP.EXE.  Comments are discarded.
  54.  
  55.                 pp <pptok.c -l
  56.  
  57.         The following command deposits the preprocessed source file PPCHAR.C
  58.         in the file PPCHAR.PP.  #line directives are included, and name the
  59.         source file PPCHAR.C, or the files named by #include directives.
  60.         #pragma directives are included in the output, and macros within
  61.         #pragma directives are replaced.  Comments are discarded.
  62.  
  63.                 pp -lpm ppchar.c >ppchar.pp
  64.  
  65. SEE ALSO
  66.  
  67.         Steven Bruce Williams
  68.         "Using Tomorrow's C Standard Today"
  69.         Computer Language Magazine
  70.         Volume 5, Number 7
  71.         July 1988
  72.  
  73.         Draft Proposed American National Standard for Information Systems --
  74.         Programming Language C - X3 Secretariat: Computer and Business
  75.         Equipment Manufacturers Association - Available from Global
  76.         Engineering Documents, Inc. 800-854-7179
  77.  
  78. DIAGNOSTICS
  79.  
  80.         # must be followed by macro parameter.
  81.         ## may not be first or last.
  82.         "defined" may not be defined as a macro.
  83.         #elif without #if.
  84.         #else without #if.
  85.         #endif without #if.
  86.         Empty macro argument may not follow ##.
  87.         Empty macro argument may not precede ##.
  88.         End of input in constant expression.
  89.         End of input in macro arguments.
  90.         #if directives nested too deeply.
  91.         "#include" files nested too deeply.
  92.         Internal error.
  93.         Invalid "#define" directive.
  94.         Invalid "#undef" directive.
  95.         Invalid #ifdef directive.
  96.         Invalid argument to "defined".
  97.         Invalid constant expression.
  98.         Invalid parameter list in "#define".
  99.         Invalid redefinition of macro.
  100.         Invalid token follows ##.
  101.         Invalid token precedes ##.
  102.         Missing ')' in argument to "defined" operator.
  103.         Missing ')' in constant expression.
  104.         Missing ':' in conditional expression.
  105.         Predefined macros may not be "#undef"ined.
  106.         Predefined macros may not be redefined.
  107.         Preprocessor directive "#error".
  108.         Too few macro arguments.
  109.         Too many macro arguments.
  110.         Unable to find "#include" file.
  111.         Unable to open "#include" file.
  112.         Unrecognized "#include" directive.
  113.         Unrecognized "#line" directive.
  114.         Unrecognized constant expression.
  115.         Unrecognized preprocessor directive.
  116.         Unrecognized token.
  117.  
  118. BUGS
  119.  
  120.         An invalid token is diagnosed upon encountering just two periods:
  121.         "..".  Two periods should be taken as two consecutive "dot" tokens.
  122.         This bug notwithstanding, an ellipsis "...", a dot ".", and certain
  123.         float constants followed by a dot "1.." are handled correctly.
  124.  
  125.         Token pasting is quite limited.  The left token must be an identifier.
  126.         The right token must be either an identifier or an integer.  The
  127.         result is always an identifier.  Although this probably permits the
  128.         most common usage, there are certainly others that are valid.
  129.